﻿<%@ Page Title="" Language="C#" MasterPageFile="~/CmsSystem/MasterPage/AdminForm.Master"
    AutoEventWireup="true" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="/Scripts/jqGrid/lan/grid.locale-cn.js" type="text/javascript"></script>
    <script src="/Scripts/jqGrid/jquery.jqGrid.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="/Scripts/customgrideditor.js"></script>
    <link href="/App_Themes/Default/jqueryui/jquery-ui-1.7.1.custom.css" rel="stylesheet"
        type="text/css" />
    <link href="/App_Themes/Default/ui.jqgrid.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/json.js" type="text/javascript"></script>
    <script src="/Scripts/easyui/easyloader.js" type="text/javascript"></script>
    <script type="text/javascript">
        FormID = "Rssrules";
        var setting = {
            colNames: ['ID', '编号', '标题', '规则', '广告规则', '对应数据库字段'],
            colModel: [
                     { name: 'Id', index: 'Id', sorttype: "int", width: 80, key: true, hidden: true },
                     { name: 'Ruleid', width: 120, hidden: true },
                     { name: 'Title', width: 150, editable: true },
                     { name: 'Rule', width: 180, editable: true },
                     { name: 'Adrule', width: 180, editable: true },
                     { name: 'Dbfield', width: 180, editable: true, edittype: "custom", editoptions: { custom_element: initDbField, custom_value: getDbField, tablename: "INFO"} },
                    ]
        };
        $(function () {
            var assign = {};
            assign["Ruleid"] = ID;
            gridLoad("Rules", setting, assign);
            FormLoadCallBack = function () {
                using("combobox", function () {
                    $("[name=SITEID]").combobox({
                        width: 100, valueField: '0', textField: '1', editable: false,
                        url: "/tools/JSON.ashx?param=ctrl&type=combobox&act=getallsite",
                        onLoadSuccess: function (e, f) {
                            var v = $(this).combobox("getValue");
                            if (v && v != "") {
                                $(this).combobox("setValue", v); //.combobox("setText", txt)
                            }
                        }
                    });
                });
            }
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="row">
        <label class="label">
            标题</label>
        <label class="input">
            <input type="hidden" name="ID" id="ID" />
            <input type="text" name="TITLE" class="I" /></label>     
    </div>
     <div class="row">
        <label class="label">
            表名</label>
        <label class="input">
            <input type="text" name="TABLENAME" class="I" /></label>
        <label class="label">
            站点</label>
        <label class="input">
            <select name="SITEID" class="I">
            </select></label>
    </div>
    <fieldset>
        <legend>规则</legend>
        <table id="Rules">
        </table>
        <div id="gridpagerRules">
        </div>
    </fieldset>
</asp:Content>
